$(function() {
                Cufon.replace('a, span').CSS.ready(function() {
                    var $menu 		= $("#slidingMenu");
                    var $selected	= $menu.find('li:first');
                    var $moving		= $('<li />',{
                        className	: 'move',
                        top			: $selected[0].offsetTop + 'px',
                        width		: $selected[0].offsetWidth + 'px'
                    });		
                    $('#slidingMenuDesc > div').each(function(i){
                        var $this = $(this);
                        $this.css('top',$menu.find('li:nth-child('+parseInt(i+2)+')')[0].offsetTop + 'px');
                    });
                    $menu.bind('mouseleave',function(){
                        moveTo($selected,400);
                    })
                    .append($moving)
                    .find('li')
                    .not('.move')
                    .bind('mouseenter',function(){
                        var $this = $(this);
                        var offsetLeft = $this.offset().left - 20;
                        $('#slidingMenuDesc > div:nth-child('+ parseInt($this.index()) +')').stop(true).animate({'width':offsetLeft+'px'},400, 'easeOutExpo');                       
                        moveTo($this,400);
                    })
                    .bind('mouseleave',function(){
                        var $this = $(this);
                        var offsetLeft = $this.offset().left - 20;
                        //slide out the description
                        $('#slidingMenuDesc > div:nth-child('+ parseInt($this.index()) +')').stop(true).animate({'width':'0px'},400, 'easeOutExpo');
                    });;
			
                    function moveTo($elem,speed){
                        $moving.stop(true).animate({
                            top		: $elem[0].offsetTop + 'px',
                            width	: $elem[0].offsetWidth + 'px'
                        }, speed, 'easeOutExpo');
                    }
                }) ;
            });/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


